//
//  AppDelegate.m
//  ZZLC
//
//  Created by 杨春至 on 2017/12/13.
//  Copyright © 2017年 ZhongZeng. All rights reserved.
//

#import "AppDelegate.h"
#import "ZZTabViewController.h"
#import <IQKeyboardManager.h>
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   
    [self loadBaseRootViewController];
    return YES;
}

- (void)loadBaseRootViewController{
    [[IQKeyboardManager sharedManager] setEnable:YES];
    [IQKeyboardManager sharedManager].shouldResignOnTouchOutside = YES;
    [[IQKeyboardManager sharedManager] setToolbarManageBehaviour:IQAutoToolbarByPosition];
    ZZTabViewController *tabVC = [[ZZTabViewController alloc]init];
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window setRootViewController:tabVC];
    [self.window makeKeyAndVisible];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    
}
- (void)tabBarSelectAtIndex:(NSInteger)index{
//    ZZTabViewController *tabVC;
    if ([self.window.rootViewController isKindOfClass:[ZZTabViewController class]]) {
        ZZTabViewController *tabVC = (id)self.window.rootViewController;
        [tabVC setSelectedIndex:index];
    }
}
@end
